package com.lingnan.tijian.controller;

import com.lingnan.tijian.domain.OverallResult;
import com.lingnan.tijian.domain.result.Result;
import com.lingnan.tijian.domain.vo.OverallResultVO;
import com.lingnan.tijian.domain.vo.ReportDetailVO;
import com.lingnan.tijian.service.IOverallResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
@RequestMapping("/report")
public class OverallResultController {
    @Autowired
    private IOverallResultService overallResultService;

    @GetMapping("/result/{id}")
    public Result<List<OverallResultVO>> selectOverallResultlistByOrderId(@PathVariable Long id){
        List<OverallResultVO> list = overallResultService.selectOverallResultlistByOrderId(id);
        return Result.success(list);
    }

    @GetMapping("/detail/{id}")
    public Result<List<ReportDetailVO>> selectReportDetailList(@PathVariable Long id){
        List<ReportDetailVO> list = overallResultService.selectReportDetailList(id);
        return Result.success(list);
    }
}
